#基于openjdk8-openj9构建
FROM registry.comtom.cn:2443/ct-ewbs-release/openjdk8-openj9:alpine-slim

#MAINTAINER 维护者信息
MAINTAINER liuhy 

#ENV 设置环境变量
ENV PATH /usr/local/bin:$PATH
ENV serverPort 9007
ENV configDir signature
ENV JAVA_OPTIONS -Xmx512m
ENV profile profile
#shm1814配置文件路径
ENV UNION /data/apps/jar/shm1814/srj1401Hsm.conf
#srj1401配置文件路径
ENV UNIONCONF /data/apps/jar/srj1401
ENV LD_LIBRARY_PATH /usr/etc/tasslibs:$LD_LIBRARY_PATH

#复制配置文件
COPY ./target/*.jar /data/apps/jar/signature-service.jar
COPY ./src/main/resources /data/apps/config/$configDir/
COPY ./so/sjj1507 /opt/jdk/lib/amd64/
COPY ./so /data/apps/jar/
COPY ./so/sjj1313 /usr/etc/tasslibs
COPY ./so/softalg /usr/lib/
COPY ./src/main/resources/db /data/apps/jar/db/
#设置数据挂载目录以及工作目录
VOLUME ["/data/apps","/data/logs","/data/files/db"]
WORKDIR /data/apps

#设置对外的端口号
EXPOSE 9007

#容器启动后执行该命令
CMD java $JAVA_OPTIONS -Djava.security.egd=file:/dev/./urandom -jar /data/apps/jar/signature-service.jar --spring.profiles.active=${profile}  --server.port=$serverPort --spring.config.location=/data/apps/config/$configDir/
